home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
352_01
/
strppfna.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-28
|
605b
|
26 lines
// STRPPFNA.CPP contains String::findAny()
// routine finds first occurance in 'this' of any char of the string a
// obeys String::caseSens
#include <stdlib.h>
#include <string.h>
#include <alloc.h>
#include <iostream.h>
#include <ctype.h>
#include "dblib.h"
int String::findAny ( char *a )
{
if ( a==NULL ) return -1;
int nb = strlen (a);
int sn = n;
char *ss = s;
for ( int i=0; i<sn; ++i )
{
// examine each letter in String 'this' for any char in pattern a.
if ( 0<= String::findchr(a, nb, ss[i]) ) return i;
}
return -1;
} // end String::findAny()